import * as TYPES from "../action-types";
import api from "../../api";

const storeActions = {
  async getStoreList() {
    let list = null;
    try {
      const { code, data } = await api.storeList();
      if (+code === 0) {
        list = data;
      }
    } catch (error) {}
    return {
      type: TYPES.GET_STORE_LISTS,
      list,
    };
  },
  removeStoreListById(id) {
    return {
      type: TYPES.STORE_REMOVE,
      id,
    };
  },
};
export default storeActions;
